<template>
  <div>
    <van-tabbar class="tan" v-model="active">
      <van-tabbar-item icon="home-o">外卖</van-tabbar-item>
      <van-tabbar-item icon="search">搜索</van-tabbar-item>
      <van-tabbar-item icon="friends-o">订单</van-tabbar-item>
      <van-tabbar-item icon="setting-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      active: 0,
    };
  },
  methods:{
    //  chuan(){
    //    this.active=this.$route.query.id;
    //  }
  },
  watch:{
    // "$route":"chuan",
    active(value){
      // if(value==0){
      //   this.$router.push('')
      // }
      switch(value){
        case 0:
          this.$router.push('/');
          break;
        case 1:
          this.$router.push('/search');
          break;
        case 2:
          this.$router.push('/dingDan');
          break;
        case 3:
          this.$router.push('/geRen');
          break;
      }
    }
  }
};
</script>

<style scoped>
.tan{
  width: 100vw;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
/* a:hover{
  color: blue;
} */
</style>